package com.wangmeng.book.utils;

import java.io.InputStream;
import java.io.Serializable;
import java.util.Properties;

/**
 * User: 王猛
 * Date: 13-9-11
 */
public class ConstValueUtils implements Serializable {
    public static final int SOURCE_TYPE_TX = 1;
    public static final int SOURCE_TYPE_SN = 2;
    public static final int SOURCE_TYPE_WY = 3;
    public static final int SOURCE_TYPE_SH = 4;

    public static final int BOOK_TYPE_COMMON = 0;
    public static final int BOOK_TYPE_HOT = 1;
    public static final int BOOK_TYPE_TJ = 2;


    public static final String STATUS_FINISHED = "完结";
    public static final String STATUS_CONTINUE = "未完待续";
    public static final String STATUS_SELECTED = "节选";

    public static final int CODE_SUCCESS = 0;

    public static final int CODE_EXCEPTION = 1;

    public static final int STORE_TYPE_DB = 1;
    public static final int STORE_TYPE_FILE = 2;

    public static final int APPROVE_INIT = 0;//初始化，待审批
    public static final int APPROVE_RECEIVE = 1;//接收内容
    public static final int APPROVE_REJECT = 2;//拒绝，放弃接收
    public static final int APPROVE_RECEIVE_SUCCESS = 3;//接收内容成功
    public static final int APPROVE_RECEIVE_FAIL = 4;//接收内容失败
    public static final int APPROVE_PUBLISH = 5;//发布内容
//    public static final int APPROVE_NOT_PUBLISH_UPDATE = 6;//未发布内容有更新
    public static final int APPROVE_HAS_UPDATE = 6;//已发布内容有更新
    public static final int APPROVE_PUBLISH_SUCCESS = 7;//发布完成
    public static final int APPROVE_PUBLISH_FAIL = 8;//发布失败
    //正在执行中
    public static final int APPROVE_DOING = -1;

    public static final int JOB_LIST = 1;
    public static final int JOB_LOAD = 2;
    public static final int JOB_UPDATE = 3;
    public static final int JOB_PUBLISH = 4;
    public static String WEB_HOST = "localhost";
    public static String WEB_USERNAME = "test";
    public static String WEB_PASSWORD = "test";

    static {
        InputStream in = ConstValueUtils.class.getClassLoader().getResourceAsStream("config.properties");
        try{
            Properties prop = new Properties();
            prop.load(in);
            WEB_HOST = prop.getProperty("WEB.HOST");
            WEB_USERNAME = prop.getProperty("WEB.USERNAME");
            WEB_PASSWORD = prop.getProperty("WEB.PASSWORD");
        }catch (Exception ex){

        }
    }
}
